home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 61 / 061.d81 / vcr companion (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  213 lines

  1. 90 print "[147]":poke 53280,0:poke 53281,0
  2. 100 gosub 4000:goto 3000
  3. 290 print "[156][147]            building table      "
  4. 292 print "num  -------  name  ------   tape.entry"
  5. 300 for v=1 to tb :gosub1000:next:return
  6. 490 rem --------------------- error chk
  7. 500 input#15,e,e$,a,b
  8. 510 ife<20ore=73thenreturn
  9. 520 ife=50thenreturn
  10. 530 print"there is an i/o problem"
  11. 540 print"error # is";e;" ";e$
  12. 550 print"track";a;"; sector";b
  13. 560 close8:close15
  14. 570 print"[156]press space to continue[146][145][145]";
  15. 580 ifpeek(203)=64then580
  16. 590 ifpeek(203)<>60then580
  17. 600 clr:goto90
  18. 900 rem open command chnl
  19. 910 close15:open 15,8,15:gosub490:return
  20. 950 rh=int(rn/256):rl=rn-(256*rh):return
  21. 1000 gosub900:v$=tb$(v)
  22. 1003 print#15,"r0:"+v$+"="+v$:input#15,er
  23. 1010 if er<>63 then rn=8: goto 1100
  24. 1020 open8,8,8,"0:"+(v$)+",l,"+chr$(40):gosub490
  25. 1030 for rn=1to8:gosub950:print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
  26. 1040 gosub490:input#8,aa$,bb$,cc$,dd$,ee$:gosub490
  27. 1050 if aa$=chr$(255)then rn=8: goto 1090
  28. 1060 if cc$=""then 1090
  29. 1070 gosub 1300:rem str in tab
  30. 1090 next
  31. 1100 close8:close15:fi=1:return
  32. 1290 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
  33. 1300 rem in tab
  34. 1310 pt=pt+1:n$(pt)=cc$:tg(pt)=pt:tn(pt)=val(v$)*10+rn
  35. 1312 print"                                      [145]"
  36. 1315 print pt-1  ;"- ";cc$;tab(30);val(v$);rn;"[145]"
  37. 1320 gosub 1800:return
  38. 1400 rem get directory
  39. 1410 close15:open15,8,15,"i0":gosub490:open2,8,2,"#":gosub490:bt=0
  40. 1415 print "[146][156][147]          getting directory"
  41. 1420 t$=chr$(18):s$=chr$(1)
  42. 1430 gosub 1600:get#2,t$,s$
  43. 1440 fori=1to 8:bp=2+((i-1)*32):gosub1650:a1=0
  44. 1450 get#2,a$:ifasc(a$+z$)<>132 then  1520
  45. 1460 get#2,a$,a$
  46. 1470 get#2,a$:a=asc(a$+z$):if a=160 then 1500
  47. 1480 ifa<48ora>57then 1520
  48. 1490 a=a-48:a1=a1*10+a:goto1470
  49. 1500 if a1<1ora1>200 then 1520
  50. 1510 gosub 1700
  51. 1520 next:if asc(t$+z$)<>0then1430
  52. 1530 close2:close15:return
  53. 1600 rem read "u1"
  54. 1610 print#15,"u1";2;0;asc(t$+z$);asc(s$+z$):gosub 490
  55. 1620 return
  56. 1650 rem buff ptr
  57. 1660 print#15,"b-p";2;bp:gosub 490
  58. 1670 return
  59. 1700 a$=str$(a1):l=len(a$):tb=tb+1:if tb>200then 1740
  60. 1710 tb$(tb)=mid$(a$,2,(l-1))
  61. 1720 print "[146]                              [145]"
  62. 1730 print "[146][158]          directory entry ";tb$(tb);"[145]"
  63. 1740 return
  64. 1800 rem insert in table
  65. 1810 lo=1:hi=pt-1:yw=0:ifpt>(2^pw)then pw=pw+1:goto1810
  66. 1820 df=int((hi-lo)/2+.5):md=lo+df
  67. 1830 if df=0 then 1870
  68. 1835 yw=yw+1:ifyw>pwthen 1870
  69. 1840 if cc$>n$(tg(md)) then lo=md:goto1820
  70. 1850 if cc$=n$(tg(md)) then 1870
  71. 1860 hi=md:df=int((hi-lo)/2+.5):md=hi-df:goto 1830
  72. 1870 lo=pt:if cc$>n$(tg(md))then md=md+1
  73. 1880 tg(lo)=tg(lo-1):lo=lo-1:if lo>md then 1880
  74. 1890 tg(md)=pt:return
  75. 1900 rem add on end/repl
  76. 1910 print "[146][158]     build on end of table? (y/n)":tb=0
  77. 1920 poke 198,0:wait 198,15:geta$
  78. 1930 if a$="n" then print "           replacing table!":gosub4100:return
  79. 1940 if a$<>"y"then 1920
  80. 1950 print "     building on the end of table!":return
  81. 2000 rem display names
  82. 2010 lc=0:i=0
  83. 2020 print "[146][147]            alphabetic list"
  84. 2030 print   "num     -----  name  ------  tape.entry "
  85. 2050 lc=lc+1:if lc>15 then gosub2300:gosub2200
  86. 2055 i=i+1:s1=2+-1*(i<10)+-1*(i<100)+-1*(i<1000):l=len(n$(tg(i)))
  87. 2056 s2=23-l+1*(tn(tg(i))>100)+1*(tn(tg(i))>1000)
  88. 2058 if mid$(n$(tg(i)),1,1)=chr$(255)then lc=lc-1:goto2070
  89. 2060 print "[159]";i;spc(s1);n$(tg(i));spc(s2);tn(tg(i))/10
  90. 2070 if i<(pt-1) then 2050
  91. 2080 return
  92. 2200 rem clear page
  93. 2210 print "":for j=1 to 16:print"                                     "
  94. 2220 next:print "":return
  95. 2300 rem wait
  96. 2310 poke 198,0:wait 198,15:geta$:lc=1:return
  97. 2500 rem print names
  98. 2510 lc=0:i=0:close4:open4,4:print#4,chr$(0):if st<>0 then 2590
  99. 2515 close4:open4,4,0
  100. 2520 print#4,"            alphabetic list"
  101. 2530 print#4,"      num     -----  name  ------ tape.entry ";chr$(13)
  102. 2550 lc=lc+1:if lc>56  then lc=0:forj=1to7:print#4,chr$(0):next:goto2520
  103. 2555 i=i+1:s1=2+-1*(i<10)+-1*(i<100)+-1*(i<1000):l=len(n$(tg(i)))
  104. 2556 s2=23-l+1*(tn(tg(i))>100)+1*(tn(tg(i))>1000)
  105. 2558 if mid$(n$(tg(i)),1,1)=chr$(255)then 2570
  106. 2560 print#4,"     ";i;spc(s1);n$(tg(i));spc(s2);tn(tg(i))/10
  107. 2570 if i<(pt-1) then 2550
  108. 2580 close4:return
  109. 2590 print:print"         printer unavailable":return
  110. 3000 rem menu
  111. 3010 print"":print "[147][213][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][201]";
  112. 3020 print "[221] [146]d[146]isplay       [146]l[146]oad        [146]a[146]dd        [221]";
  113. 3030 print "[221] [146]p[146]rint         [146]save        [146]b[146]uild      [221]";
  114. 3035 print "[221] [146]m[146]ain menu     [146]h[146]elp        l[146]o[146]adstar   [221]";
  115. 3040 print   "[202][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][203]";
  116. 3050 poke 198,0:wait 198,15:get a$:
  117. 3060 if a$="d" then gosub 2000:goto3200:rem disp
  118. 3070 if a$="p" then gosub 2500:goto3200:rem print
  119. 3080 if a$="m" then f$="vcr library":n$="main menu":goto4500
  120. 3085 if a$="o" then f$="hello connect":n$="loadstar":goto4500
  121. 3090 if a$="s" then gosub3300:goto3200:rem save
  122. 3100 if a$="a" then gosub3500:goto3200:rem add
  123. 3110 if a$="l" then gosub3400:goto3200:rem load
  124. 3115 if a$="h" then gosub3800:goto3200:rem load
  125. 3120 if a$="b" then gosub1900:gosub1400:gosub290:goto3200:rem build
  126. 3150 goto3050
  127. 3200 print"[146]          any key continues"
  128. 3210 poke 198,0:wait 198,15:geta$:goto 3010
  129. 3300 rem save file
  130. 3310 print "[146]            saving file!    ":ifpt>1then 3330
  131. 3320 print "[158]           no file to save[146]":goto3200
  132. 3330 close15:open15,8,15,"i0":gosub490:print#15,"s0:999":gosub490
  133. 3335 close15:open15,8,15,"i0":gosub490:open3,8,3,"@0:999,s,w":gosub490
  134. 3340 for i=1 to pt:if left$(n$(tg(i)),1)=chr$(255) then 3360
  135. 3350 print#3,i:print#3,n$(tg(i)):print#3,tn(tg(i)):x=i
  136. 3360 next:print#3,x+1:print#3,chr$(255)+chr$(255)+chr$(255):print#3,0
  137. 3370 close3:close15:fi=0:return
  138. 3400 rem load file
  139. 3405 print "[146]            loading file!    ":pt=0:pw=0
  140. 3410 close15:open15,8,15,"i0":gosub490:print#15,"r0:999=999":input#15,er
  141. 3420 if er<>63 then 3490
  142. 3430 close15:open15,8,15,"i0":gosub490:open3,8,3,"999,s,r":gosub490
  143. 3440 pt=pt+1:input#3,tg(pt),n$(pt),tn(pt)
  144. 3450 if left$(n$(pt),1)<>chr$(255) then 3440
  145. 3460 tg(pt)=pt:n$(pt)=chr$(255)+chr$(255)+chr$(255):tn(pt)=0
  146. 3470 close3:close15:fi=1:return
  147. 3490 print "           [158]no file to load[146]":return
  148. 3500 rem add/update
  149. 3510 print "[146][147][158]        enter add file name":a1=0:a1$=""
  150. 3515 print "               [213][195][195][195][195][201]"
  151. 3516 print "               [221]    [221]"
  152. 3517 print "               [202][195][195][195][195][203] [145][145]"
  153. 3520 get a$:if a$=""then 3520
  154. 3530 a=asc(a$):if a=13 then 3570
  155. 3540 if a=20 then 3600
  156. 3550 if a<48ora>57then3520
  157. 3560 if len(a1$)<3 thena1$=a1$+a$
  158. 3562 print "  ";a1$;" [145]":goto3520
  159. 3570 a=val(a1$):if a<1 or a>200 then 3590
  160. 3580 v$=a1$:goto3630
  161. 3590 print "[146]         invalid file name":return
  162. 3600 l=len(a1$):l=l-1:ifl<0then l=0
  163. 3610 a1$=mid$(a1$,1,l):goto3562
  164. 3630 close15:open15,8,15,"i0":print#15,"r0:"+v$+"="+v$:input#15,er
  165. 3640 if er=63 then print"":goto3660
  166. 3650 print "[146]           [159]file not found":return
  167. 3660 i=0:a=val(v$)*10
  168. 3670 i=i+1:ifi>pt then 3750
  169. 3680 if tn(i)>a and tn(i)<a+10 then 3690
  170. 3683 goto 3670
  171. 3690 print"                                 [145]":print "  deleting: ";n$(i)"[145]"
  172. 3695 j=0:n$(i)=chr$(255)+chr$(255)+chr$(255):tn(i)=0
  173. 3700 j=j+1:if j>=pt then 3670
  174. 3710 if tg(j)<>i then 3700
  175. 3720 lo=j
  176. 3730 tg(lo)=tg(lo+1):lo=lo+1:iflo<ptthen3730
  177. 3740 tg(pt)=i:goto 3700
  178. 3750 tb=1:tb$(1)=v$:gosub290:fi=1:close3:close15:return
  179. 3800 print "[146][147][159]display: displays current file in table"
  180. 3810 print "[159]print: prints current file in table"
  181. 3820 print "[159]build: builds an alphabetic table file"
  182. 3825 print "from all the individual tape files"
  183. 3830 print "[159]save: saves the current table file"
  184. 3835 print "